package com.wzy.Controller;


import com.wzy.entity.Violence;
import com.wzy.service.ViolenceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author wzy
 * @since 2021-02-09
 */
@Controller
public class ViolenceController {


    @Autowired
    private ViolenceService violenceService;

    /**
     *  跳转到日寇暴行页面,未进行数据渲染
     *
     * @return
     */

    @GetMapping("/violence")
    public String routerViolencePage(Model model) {


      List<Violence>  violenceList= violenceService.getViolenceList();
        model.addAttribute("violenceList",violenceList);
        return "violence";
    }

}

